030e40943c14df3ea2d3e4024e2adf8ae02ac7a0,src/main/java/org/basex/gui/layout/BaseXText.java,BaseXText,keyPressed,#KeyEvent#,342
Before Change
// edit operations...
if(CUT.is(e)) {
cut();
} else if(PASTE.is(e)) {
paste();
} else if(UNDO.is(e)) {
undo();
After Change
scroll.pos(scroll.pos() - fh);
return;
}
if(COPY1.is(e) || COPY2.is(e)) {
copy();
return;
}
// set cursor position and reset last column
text.pos(text.cursor());
if(!PREVLINE.is(e) && !NEXTLINE.is(e)) lastCol = -1;
if(FINDNEXT.is(e) || FINDPREV.is(e) || FINDNEXT2.is(e) || FINDPREV2.is(e)) {
find(rend.find(FINDPREV.is(e) || FINDPREV2.is(e), true));
return;
}
if(SELECTALL.is(e)) {
selectAll();
text.setCaret();
return;
}
final boolean marking = e.isShiftDown() &&
!DELNEXT.is(e) && !DELPREV.is(e) && !PASTE2.is(e);
final boolean nomark = text.start() == -1;
if(!PASTE2.is(e) && marking && nomark) text.startMark();
boolean down = true;
boolean consumed = true;
// operations that consider the last text mark..
if(NEXTWORD.is(e)) {
text.nextToken(marking);
} else if(PREVWORD.is(e)) {
text.prevToken(marking);
down = false;
} else if(TEXTSTART.is(e)) {
if(!marking) text.noMark();
text.pos(0);
down = false;
} else if(TEXTEND.is(e)) {
if(!marking) text.noMark();
text.pos(text.size());
} else if(LINESTART.is(e)) {
text.bol(marking);
down = false;
} else if(LINEEND.is(e)) {
text.forward(Integer.MAX_VALUE, marking);
} else if(NEXTPAGE.is(e)) {
down(getHeight() / fh, marking);
} else if(PREVPAGE.is(e)) {
up(getHeight() / fh, marking);
down = false;
} else if(NEXT.is(e)) {
text.next(marking);
} else if(PREV.is(e)) {
text.prev(marking);
down = false;
} else if(PREVLINE.is(e)) {
up(1, marking);
down = false;
} else if(NEXTLINE.is(e)) {
down(1, marking);
} else {
consumed = false;
}
final byte[] txt = text.text;
if(marking) {
// refresh scroll position
text.endMark();
text.checkMark();
} else if(undo != null) {
// edit operations...
if(CUT1.is(e) || CUT2.is(e)) {
cut();
} else if(PASTE1.is(e) || PASTE2.is(e)) {
paste();